Skip to content

fix: map Ark video generation availability (#675) - #676

Merged
wangtiance merged 2 commits into
ThinkFlowLab:mainfrom
dongzhi-pan:codex/fix-675-ark-availability
Dec 5, 2026
Merged

wangtiance merged 2 commits into
ThinkFlowLab:mainfrom
dongzhi-pan:codex/fix-675-ark-availability

Conversation

@dongzhi-pan

@dongzhi-pan dongzhi-pan commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Ark video models already have a generation provider, but availability discovery returned adapter_not_mapped with no operations. This change maps text-to-video and image-to-video generation to the configured /contents/generations/tasks route while preserving its base prefix. Unchecked services remain unknown/not_checked; standalone video tools remain unsupported.

Addressing the duration review suggestion, admission and the actual Ark JSON POST now call the same normalize_ark_parameters function. Integral numeric values such as 5.0 become integer 5; fractional values are not rounded and the original parameters are not mutated. The branch includes main through 181a5efb8bf8b03c8dd37b56b6ad5efdd88912e3; target main has since advanced to f3251839da5a52818ade05eec766fee3cc51d3f9.

Fixes #675 (capability discovery scope).

Validation

  • Original regression evidence: five discovery/admission cases fail on the original base 461f31e44249fcccc12f152adc1e2b79b3348b50.
  • Six additional HTTP-double cases compare checked duration values and types against actual serialized POST JSON for integral floats, integers, fractional values, booleans, strings and omitted duration.
  • On candidate c802be0e7a27e93a2170108f5fcd5fe79b3e2087, the following selection passed 202 tests on Windows with FFmpeg/ffprobe and imports pinned to the PR worktree:
    python -m pytest tests/test_ark_availability.py tests/test_model_availability.py tests/test_capability_contract_integration.py tests/test_video_resolution.py tests/test_creation_parameters.py -q --tb=short
  • git diff --check origin/main...HEAD passes.
  • Release checks, CodeQL/DSH and the full repository gate have not been verified on this new head. All three exact-head workflow runs currently report action_required, awaiting maintainer approval.

Evidence

Fresh current-head settings screenshot, reproduction steps and same-session API receipt. Captured against clean c802be0e7a27e93a2170108f5fcd5fe79b3e2087 backend code in isolated temporary storage, using the existing production frontend build. The card shows the synthetic gateway prefix, Seedance ID, Not checked and both video operations. The artifact-only commit adds no application-code changes; the PR head is unchanged.

Fresh current-head application API receipt and captured POST JSON comparison. The isolated TestClient discovery request returned HTTP 200, and all six duration captures matched admission values and types with one mock POST per case and unchanged inputs. Synthetic 400 responses terminate the capture; they are not live-provider failures.

Reproduction steps, capability-card screenshot and sanitized before/after receipt.

The screenshot was captured on the original PR revision 29c7d53e017d2eacc60a4f668b85f5c89ded5b80 using an isolated synthetic configuration and the production frontend. It is historical UI evidence, not a fresh screenshot of this head. The duration extraction has no new UI behavior; its evidence is the comparison with actual HTTP-double JSON requests.

Scope and remaining verification

No real-provider generation request was made for this validation. Gateway authentication, output quality and the later submission_unknown root cause remain unverified. The separate local Seedance host-matching fix and transport diagnostics described in the issue comments are not included in this update. No UI copy changed.

Independent current-head evidence rescore: 93/100, no new blocking code findings (scope 3/3, correctness 3/3, validation 2/3, claim evidence 3/3, simplicity 3/3). The independent reviewer inspected the new screenshot and same-session receipt, matched the image SHA-256, and verified that artifact commit 768639b2703b152a2ae36b8425c5f84a9ea641f2 has tested head c802be0e7a27e93a2170108f5fcd5fe79b3e2087 as its parent and changes only three evidence files. Together with the 202 selected tests, independent 11-case rerun and six captured HTTP-double payload cases, this closes the current-head visual evidence gap.

Formal verdict remains WITHHOLD: required CI awaits maintainer approval and the branch is behind current main. Reviewed target: f3251839da5a52818ade05eec766fee3cc51d3f9; PR merge base: 181a5efb8bf8b03c8dd37b56b6ad5efdd88912e3; tested head: c802be0e7a27e93a2170108f5fcd5fe79b3e2087. Evidence is 30/30; this is not 100/100 overall or merge approval. Previous 83/100 reviews are superseded for evidence scoring by this refresh.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD 29c7d53 Fixes #675

已核对设置页截图和前后 JSON:自定义 Base URL 前缀保留,修复后列出文生和图生视频,两条仍是 unknown/not_checked。代码把 duration 与实际请求对齐为整数,同时没有把独立视频工具误报成已接入。作者的 196 项是本地 fixture,不是网关鉴权或真实生成验证。

当前证据暂定 90/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 2;各满分 3)。建议后续用同一个函数归一化发送与能力检查的 duration,目前两处各自实现。Ran: diff、路由调用、截图、回执与 Checks 核对。Not run: provider、CI;Release、CodeQL、DSH 均在等待 fork workflow 放行,本条不代表已放行。

Dot,代表 @david6666666;非表决。

Synchronize main and compare checked duration values with the actual JSON payload without rounding fractional durations or mutating generation intent.

Copy link
Copy Markdown
Contributor Author

Evidence refresh for c802be0e7a27e93a2170108f5fcd5fe79b3e2087

Fresh checks were run against the committed PR worktree, using isolated temporary storage and synthetic credentials. No user project or real gateway generation was used.

Application API receipt

The real FastAPI application, exercised via TestClient, returned HTTP 200 from GET /api/model-configs/availability:

{
  "status": "unknown",
  "reasonCode": "not_checked",
  "operations": [
    {
      "profile": "text_to_video",
      "method": "POST",
      "path": "/doubao/api/v3/contents/generations/tasks",
      "status": "unknown",
      "reasonCode": "not_checked"
    },
    {
      "profile": "image_to_video",
      "method": "POST",
      "path": "/doubao/api/v3/contents/generations/tasks",
      "status": "unknown",
      "reasonCode": "not_checked"
    }
  ]
}

This verifies discovery and preservation of the configured base-path prefix, without claiming that the unchecked gateway is available.

Captured Ark POST JSON versus admission

The real VolcengineGeneration.generate() adapter serialized requests to an HTTP model double. Each captured JSON parameter matched the admission value and type:

Original duration Checked duration Sent JSON duration Decoded type POST count
5.0 5 5 integer 1
5 5 5 integer 1
5.5 5.5 5.5 float 1
false false false boolean 1
"5" "5" "5" string 1
omitted omitted omitted absent 1

All six original parameter dictionaries remained unchanged. Fractional durations were not rounded. Boolean/string cases establish serialization parity only; they do not claim those inputs are accepted by Ark. The double deliberately returned HTTP 400 after capture to stop before polling; that response is synthetic, not evidence of a live gateway error.

The committed cases are reproducible with:

python -m pytest tests/test_ark_availability.py -vv

The existing 202-test selected run and independent 11-test rerun remain attributed to this exact head.

Remaining gaps

  • The UI screenshot in feature-assets/issue-675 is still from 29c7d53; no new screenshot was captured in this refresh.
  • Release checks, CodeQL and DSH plugin checks on this head all report action_required, awaiting maintainer approval.
  • Live gateway authentication, successful video generation and the later submission_unknown root cause remain unverified.
  • Main has advanced to f3251839da5a52818ade05eec766fee3cc51d3f9; this is an evidence-only update, not a new code/head update.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD c802be0 Fixes #675

上一轮提出的两套 duration 逻辑已合到 normalize_ark_parameters。新 head 的 API 回执保留 prefix 和两个 operation,六种 HTTP-double 请求匹配实际 JSON 的值和类型;没有把字符串或布尔值的序列化说成 Ark 支持。设置截图是上个 SHA 的同一发现路径,不是新 head 的截图;本次发现侧有对应的当前 API 回执。

当前证据暂定 83/100(范围 3,正确性 3,验证 2,主张证据 2,简洁性 3)。Ran: 完整 diff、前后回执和同 SHA Actions 核对。Not run: 自己执行测试或真实 provider。三项 fork checks 待 GitHub 放行;不是因后续 main 推进而要求 rebase。Dot,代表 @david6666666;非表决。

Copy link
Copy Markdown
Contributor Author

Fresh settings screenshot on the current PR head

Tested head: c802be0e7a27e93a2170108f5fcd5fe79b3e2087. The PR code/head is unchanged.

Reproduction steps, fresh screenshot and matching same-session API receipt are pinned to artifact-only commit 768639b2703b152a2ae36b8425c5f84a9ea641f2, whose parent is the tested PR head and whose only changes are three evidence files.

The actual Settings > Model connections > Video > Service capabilities card shows the synthetic gateway prefix, Seedance model, Not checked, Text to video, and Image to video. The matching backend receipt preserves both task routes under /doubao/api/v3 and both unknown/not_checked results. The screenshot was captured against the clean PR backend in isolated temporary storage, using the existing production frontend build; no new frontend build or live-provider call is claimed. “Key configured” refers only to the synthetic fixture credential.

Current-head Ark capability settings

Independent evidence rescore: claim evidence 3/3 (30/30); overall 93/100. The reviewer inspected the image and receipt, matched the screenshot SHA-256, verified the artifact parent and evidence-only diff, and found no new blocking code issue. This closes the current-head screenshot gap; the original 29c7d53 image remains labeled historical.

Formal verdict remains WITHHOLD. CodeQL, Release checks and DSH plugin checks on c802be0 still report action_required; required/full CI has not completed. Target main is f3251839da5a52818ade05eec766fee3cc51d3f9 and is ahead of the PR branch. Live gateway authentication, real generation and submission_unknown remain unverified. Evidence full marks do not mean 100/100 overall or merge approval.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD c802be0 Fixes #675

我下载并打开了同 head 的 设置截图与 API 回执,JPEG 的 SHA-256 与回执匹配。截图和回执都确认保留自定义 URL 前缀、同时显示文生视频和图生视频,状态是 unknown/not_checked。这补齐了上一轮的 UI 证据,不是对真实 Ark 鉴权和生成的验证。

当前证据暂定 93/100,非批准分(范围 3、正确性 3、验证 2、主张证据 3、简洁度 3;各满分 3)。Release、CodeQL 和 DSH 仍显示 GitHub action_required,未放行。没有新的实际冲突,不因单纯落后 main 要求 rebase。Ran: 下载、查看、校验散列并比对同会话回执及 Actions;Not run: 本地应用或真实 provider。

Dot,代表 @david6666666 作非表决复审。

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS c802be0 Fixes #675

上轮待放行的同一个 head 已由维护者启动检查,Release checks、CodeQL、DSH 都通过了。此前已核验同 head 设置截图和 API receipt:自定义前缀保留,文生和图生视频仍为 unknown/not_checked;共享 duration 规范化及六个 HTTP-double 用例覆盖 admission 和 POST 的一致性。无新增 actionable finding。

Ran: 核对同 head Release 47289002622 的七个 job、CodeQL、DSH;此前离线打开并核对截图。Not run: 真实 Ark 请求,本次只验 capability mapping。100/100(范围 3、正确性 3、验证 3、证据 3、简洁性 3)。Dot,代表 @david6666666,非表决;当前未收到该账号独立投票邀请。
Coordinator: 由仓库协调人按合入流程处理。

@wangtiance
wangtiance merged commit 93bd25b into ThinkFlowLab:main Dec 5, 2026
12 checks passed
Zhangbo-cn added a commit to Zhangbo-cn/OpenDirector that referenced this pull request Dec 5, 2026
ThinkFlowLab#692 split the Python suite into three shard manifests, but ThinkFlowLab#676 added
tests/test_ark_availability.py after that list was generated, so the
manifest-coverage test fails on current main. Enroll that module together
with the seed-audio modules this branch adds so each test module is
collected exactly once.
FayeSpica pushed a commit that referenced this pull request Dec 5, 2026
…#661)

* [feat] audio: add Volcengine Ark Seed Audio 1.5 text-to-audio adapter

## summary

- Add a `seed-audio` input-rules profile, selected by `protocol=volcengine`
  plus the `doubao-seed-audio-1-5` model prefix, that publishes
  `audioTasks=['text2audio']`, `outputFormats`, `sampleRates` and
  `referencesAllowed=False` instead of guessing capabilities from a name.
- Build the request in `integrations/seed_audio.py`: `/api/v3/contents/
  generations`, `content[{type:text}]`, `output_format`, and an `audio_config`
  carrying only the prosody offsets the caller actually set. Artifacts are
  read from `content.audios[].url`.
- Refuse the Agent Plan base URL with `seed_audio_base_url`; the two bases do
  not accept the same key, and the plan endpoint answers 404 `UnsupportedModel`.
- Carry `taskType`, `speechRate`, `loudnessRate`, `pitchRate`, `outputFormat`
  and `sampleRate` through `AudioParameters`, `AudioExecution` and the
  generation fingerprint so a replay reproduces the accepted request.
- Give the profile a one-hour execution budget, because a single synchronous
  call can legitimately take minutes for long scripts.
- Add the `ark-content` provider preset (`/api/v3`) and let data rather than
  model names decide whether the composer offers 全能配音: a profile with
  `audioTasks` no longer renders the text-reading option, the voice field, or
  the read-only label.
- Let the base URL choose the preset: two Ark presets now share one protocol
  and media kind, so `providerPresetFor` prefers the preset whose URL matches
  the connection and only falls back to the first match. Without this the Seed
  Audio connection was labelled "Volcano Ark / Agent Plan" in settings.
- Accept the two reference shapes the service really takes: one image or up to
  six voice samples, never both. `image_url` and `audio_url` are exclusive at
  the provider, so the reference path rejects a mix, enforces 15 MB and 2–30 s
  per sample (180 s total), and still refuses video with a stable code.
- Stop treating every audio model as reading-only: a profile that allows
  references no longer reports the reference as unused in the composer.
- Cover the adapter with rule, request-shape, response-parsing, reference,
  validation and end-to-end job tests, and pin the profile/contract agreement
  so the sample rates cannot drift apart.

## verification

- Live probe in `docs/development/seed-audio-1-5-probe.md` keeps the measured
  matrix: every published `output_format` and `sample_rate` was requested once,
  downloaded, and probed with `ffprobe` (mp3 at 8000/16000/24000/32000/48000,
  default 44100, wav 44100 as `pcm_s16le`), with the byte counts and response
  echo recorded.

## evidence

- Live probe recorded in `docs/development/seed-audio-1-5-probe.md`: inline
  audio references only, video references rejected, synchronous response.
- Real run through the command path: 161214-byte mp3, 8.72 s, 44100 Hz stereo.
- `3516 passed, 131 skipped` on `d083cbc1`; `npm test` 1110 passed with the
  one env-only failure that also fails on `main`; build and `check:i18n` clean.
- Browser: generate, adopt (`adoptionPolicy=if_current`), reopen with the audio
  intact, and the wrong-base refusal rendered in both locales.

## scope

Text to audio plus one-image and voice-sample references. Separation,
multi-artifact results, dubbing, translation, subtitles and custom voices stay
out: every one of them needs a video or voice transport that the provider does
not expose to this key. `video_url` accepts only `http(s)://` and `tos://`, and
the Files API offers `user_data`, `agent` and `voice` purposes, so a project
video cannot reach the service without a TOS bucket or a public URL.

* [feat] storage: presign TOS objects so the provider can fetch project media

Ark accepts only `http(s)://` and `tos://` for `video_url`, and a bare
`tos://` key is refused with `AccessDenied` unless the account grants it
service access. A presigned URL keeps the object private and still lets the
service read it, so dubbing, translation and subtitle work can send a project
video without publishing it.

TOS4 signing is implemented with the standard library, so the container gains
no dependency for what is a few HMAC rounds.

Verified against the live bucket: a 68378-byte upload returned 200, the
presigned URL served the same bytes, and Ark accepted it for
`role=dubbing_video` with `target_language=zh`, returning a dubbed video, an
extracted audio track and one SRT subtitle.

Refs #650

* [feat] audio: dub a referenced video through the same Seed Audio model

A dubbing request carries a `dubbing_video` and a language pair instead of a
prompt, and comes back with three artifacts: the dubbed video, the extracted
speech track and an SRT. The service refuses text in that scene, requires
`dubbing_config`, and only accepts a video between 4 s and 6 min.

The video is uploaded to the configured bucket and sent as a presigned URL, so
a project video never has to be published. A missing storage configuration
fails before submission with `seed_audio_storage` rather than after a wasted
call.

Verified against the live service: a 6 s clip with a speech track, uploaded to
the bucket and presigned, returned `video_url`, one `audios` entry and one
`subtitles` entry with `usage.duration_ms` 6016.

Refs #650

* [feat] audio: dub from a subtitle file and validate the dubbing language pair

A dubbing request without a subtitle makes the service listen to the video.
With one, the supplied lines win, which is what a translated script needs. The
SRT is an asset of the project, uploaded through the same presigned channel as
the video, so `custom_subtitle` never carries a URL the service cannot read.

Validation now refuses a dubbing request without a target language, a language
pair outside dubbing, a subtitle outside dubbing, and a subtitle that is not a
timed SRT within 2 MB.

Refs #650

* [fix] audio: keep one language field per dubbing endpoint

The dubbing parameters declared `targetLanguage` twice, so only the last
declaration reached the generated contract and the adapter snapshot.

Refs #650

* [feat] generation: keep every artifact a job produces

## summary

One generation task can now deliver several files instead of silently keeping
only the first: a dubbed video, separated audio tracks, and subtitle sidecars
all land in the same project as real, inspectable assets.

- `ResultVersion` carries `role`, `variant`, and `track`; `primary` stays the
  adopted output referenced by `Job.asset`.
- Providers may return `GeneratedArtifact` items through an optional
  `generate_all()`; the single-file `generate()` default keeps existing
  adapters unchanged.
- The adopted output and its siblings register in one commit under their own
  idempotent handles, so a failure never leaves an output without its
  siblings, and recovery replays the same commit without duplicates.
- Artifact bytes are cached before the index (`artifacts.json`), and an index
  that cannot be validated is rejected instead of half-applied.
- `result.select` rejects sidecars, and `job.status` reports every delivered
  artifact so users and the agent read the same projection.

* [feat] audio: keep every file Seed Audio returns

## summary

The Seed Audio adapter now names every file it produces, so the persistence
layer added in the previous commit receives more than a bare `(suffix, bytes)`.

`dubbing_artifacts()` and the renamed `audio_artifacts()` answer with
`(role, url, suffix, variant, track)` tuples. The suffix comes from the URL the
vendor returned, restricted to an allow-list; subtitles are told apart by
`<scope>_<suffix>`; audio tracks are counted per `type` so two speakers cannot
claim the same identity. Dubbing requests every subtitle the response can
carry, so the parsed variants are reachable rather than theoretical.

`VolcengineGeneration.generate_all()` collects those siblings through an
optional `extra_ready` callback and downloads them itself, which keeps the
persistence layer free of URLs. Providers without fan-out keep the single-file
path, and the profile adapters that inherit the Volcengine `generate_all()`
never reach the callback.

## tests

- `python3 -m pytest tests -q -m "not browser"` -> 3552 passed, 133 skipped
- `tests/test_seed_audio.py` -> 35 passed, including the multi-track job that
  adopts the primary audio and stores `speaker:0` beside it
- `npx tsc --noEmit` -> no output; `node --test tests/*.test.ts` -> 0 fail;
  `check:i18n` -> 3828 keys, 0 problems

* [feat] audio: separate a long recording into its own tracks

Separation reads one recording up to six minutes and returns one entry per
track, so the reference bound differs from the two-to-thirty-second voice
samples a generation request takes. A separation request also carries no
subtitle and no speech, loudness or pitch adjustment, which the parameters now
refuse instead of forwarding to a service that ignores them.

Refs #650

* [feat] canvas: offer a sibling track as a node version, not a subtitle

A job that produced several files registered every one of them as a result,
so a node's version list showed all of them. A subtitle was listed as a
version of the audio node it belonged to even though adopting it fails the
media-kind check, which leaves a row the user cannot use.

The list now keeps a sibling only when its media kind matches the node. A
separated track still appears and can be adopted as that node's audio, which
is what the delivered files are for.

`result_not_adoptable` also joins the contract message catalog, so the Agent
reads the reason in English instead of a Chinese sentence.

Refs #650

## tests

- `tests/test_result_artifacts.py` -> 12 passed, including the new version
  list case that fails without the filter (`Say hello-subtitle-target_srt.srt`
  is offered) and passes with it
- `tests/test_creation_node_versions.py test_creation_crop.py
  test_creation_image_edits.py test_creation_media_publication.py
  test_command_version_contract.py` -> 108 passed
- `check:i18n` -> 3828 keys, 0 problems

* [bugfix] api: answer the side-artifact refusal in English

`result.select` rejects an audio track or subtitle with a stable
`result_not_adoptable` code, but the catalog had no English text for it, so
an English interface fell back to the generic status sentence.

The code now carries its own English sentence, and a test pins both
languages the way the neighbouring contract codes are pinned. The extended
`register` docstring from the previous commit is reverted: the contract it
described lives in `docs/architecture/unified-project.md` and in the tests.

Refs #650

## tests

- `tests/test_localization.py` -> 9 passed
- `tests/test_result_artifacts.py tests/test_agent_artifacts.py
  tests/test_creation_assets.py` -> 65 passed

* [feat] audio: explain the subtitle transport requirement before submitting

A subtitle has to reach the service as a fetchable URL, and a desktop install
has no public address to offer. Without storage the request now stops with
`audio_subtitle_transport` instead of the generic storage message, in both
interface languages.

Also pins the six-track shape: one primary plus `speaker`, `sfx`, `bgm` and
`composite` entries numbered within their own type.

Refs #650

* [bugfix] audio: send the separation intent as separate_audio

## summary

Seed Audio 1.5 tells 分轨 and 参考音频 apart by the `role` on each
`content[].audio_url`, not by `taskType`. The outbound body hardcoded
`reference_audio`, so a separation job was sent as "generate from this
audio reference" and the service answered with one re-recording instead
of the requested tracks; the canvas then showed one primary clip and the
job read as a success.

The business intent now picks the role where the request is prepared,
and the outbound body only forwards what preparation decided:

- `reference_inputs.seed_audio_references` records `separate_audio` for
  `taskType: separation` and keeps `reference_audio` for every other
  audio task, on the manifest entry too.
- `seed_audio.request_body` takes `audio_role` and no longer hardcodes it.
- `volcengine` passes the prepared role into the body.

`#650`

Tests: `tests/test_seed_audio.py` (39 passed), with red proof on both
halves. Without the adapter pass-through the separation request goes out
as `reference_audio`; without the preparation change the separation
manifest raises `KeyError: 'audio_role'`.

* [feat] models: keep the provider object-storage account with the account

## summary

Ark can only read media from an address it can fetch itself, so 翻配,
视频参考 and 按字幕配音 all need the same thing first: the source media in
object storage the user owns, handed over as a signed URL. The store
already reads `storage` from a resolved model configuration, but nothing
wrote it, so every dubbing call died on `seed_audio_storage` before any
request went out. This adds the missing owner without inventing a second
place for credentials:

- `ModelConfigs` keeps `storage` (`accessKey`, `secretKey`, `bucket`,
  `region`) on the account layer next to the API key, so one Ark service
  and one bucket serve every model under it. It is validated on read,
  hoisted into the shared service record on write, and carried across
  edits of any model in that account.
- `storage()` answers Bucket, Region and whether the account is
  configured; neither secret is ever returned. `save_storage()` treats a
  blank field as "keep the stored value", so a settings screen never has
  to echo a secret back to change a bucket.
- An incomplete account is refused as a whole instead of failing later
  inside an adapter.

`#650`

Tests: `tests/test_model_configs.py` (36 passed) covers sharing across
one account, restart, secret masking, blank-field updates and refusal;
`tests/test_seed_audio.py` (41 passed) covers dubbing going out with the
presigned address, and refusing before any request when no account is
configured. The credential contract is written down in
`docs/architecture/unified-project.md`.

* [feat] api: let a model service hold its object-storage credentials

## summary

The storage account added for remote-fetch providers had no way in from
outside the process, so a user could not actually configure 翻配 or
视频参考. Two endpoints on the existing model-service resource close that:
`GET /api/model-services/{id}/storage` reports the bucket, region and
whether the account is usable, `POST` stores the four credentials.

Neither secret comes back: the response is a separate public shape with
no key fields at all, and the saved account is shared by every model of
the same provider service. A blank field keeps the stored value, so
changing a bucket never requires re-entering the secret, and an account
with only some of the four fields is refused up front.

The two refusals carry stable codes (`model_storage_incomplete`,
`model_storage_invalid`) registered in the contract issue codes and the
English catalog, so the interface answers them in its own language
instead of echoing Chinese.

`#650`

Tests: `tests/test_model_configs.py` (37 passed) covers the read before
any account exists, saving, masking, blank-field updates, the 409
refusal in both languages and the 404 for a deleted service;
`tests/test_creation_contracts.py` (82 passed) regenerates and checks the
new contract shapes.

* [refactor] audio: publish provider media through one helper

## summary

Ark can only read what it can fetch itself, so every request that carries
a file has to put it in the user's bucket first and hand over a signed
address. Dubbing did that inline for its video and, once subtitles
arrived, a second nearly identical block grew inside the same branch —
two copies of put, presign, cleanup and error mapping that the reference
and subtitle paths would each have had to repeat.

`_publish_media(config, task_id, data, suffix, content_type, noun=...)`
now owns that step: it refuses before writing anything when the account
is unconfigured, writes the bytes to a temporary file, uploads, presigns
for an hour and always removes the temp file. Dubbing calls it for the
video and for the subtitle, so the behaviour is the one already covered
by the existing dubbing and subtitle tests, not a new one.

The noun stays a parameter so a failure still says which file could not
be published; the error code keeps coming from the transfer so the
interface can answer in its own language.

`#650`

Tests: `tests/test_seed_audio.py` + `tests/test_result_artifacts.py`
53 passed, including the dubbing body carrying the presigned video URL and
the subtitle travelling with it.

* [refactor] audio: decide storage readiness in one place

## summary

Two call sites now need the same yes/no answer about the provider account:
the upload helper itself, and the subtitle path, which has to tell "this
job has a subtitle and nothing to publish it with" apart from a plain
missing account before it calls the helper. Keeping the four-field test
in both places would let them drift, and a drifting readiness check shows
up as a wrong error code rather than a test failure.

`_storage_ready(config)` holds it once and `_publish_media` asks it, so
the subtitle path and the helper can never disagree about whether the
same account is usable.

It stays on the Ark adapter: object storage is a property of a provider
that only reads remote URLs, not of every generation provider, and the
base class has no other reason to know about buckets.

`#650`

Tests: `tests/test_seed_audio.py` + `tests/test_result_artifacts.py`
53 passed, including dubbing refused with `seed_audio_storage` before any
request when no account is configured, and publishing the video and
subtitle when one is.

* [feat] assets: upload a subtitle file as a subtitle asset

## summary

按字幕配音 needs an uploaded SRT, but the upload inspector only recognised
`.txt` and `.md` as text. An `.srt` fell through to the media branch and
came back as a generic file, so no subtitle asset could ever exist and
`subtitleAssetId` was unreachable from the interface — the validation in
the audio reference layer was correct and simply could never be satisfied.

`.srt` now inspects as text with `application/x-subrip`, which is the type
the reference layer already accepts. The size and UTF-8 checks are the
existing text ones; a subtitle that is not valid SRT timings is still
refused later, by the rule that owns that judgement.

`#650`

Tests: `tests/test_creation_assets.py::test_an_srt_upload_becomes_a_subtitle_asset`
uploads a real SRT through the API and reads the bytes back;
`tests/test_seed_audio.py` now asserts the reference layer accepts both
`text/plain` and `application/x-subrip` subtitles. That test failed with
`kind == 'file'` before `.srt` was recognised. 235 passed across the seven
modules touched by this branch.

* [feat] audio: accept the four reference shapes Seed Audio allows

## summary

The provider takes exactly four reference combinations: one image, one
video, up to six voice clips, or one video with voice clips. The adapter
only ever implemented the first and third. A video fell into the "not
supported" branch unless the task was dubbing, and voice clips were
refused next to a video, so 视频参考生音频 and 音视频参考生音频 could not be
requested at all — both are in the acceptance list for `#650`.

Video is now a reference like any other. Dubbing keeps its own role
`dubbing_video` and its MP4-only bound; every other task sends
`reference_video` and accepts MP4 or MOV. Because the service can only
fetch video from a URL, a reference video goes through the same
`_publish_media` path as the dubbing source, and the declared content type
follows the container brand instead of assuming MP4.

The mix rule now states the real constraint: image cannot be combined with
video or voice, and dubbing cannot carry voice clips. Image plus voice
stays refused, as before.

Three codes were added so each refusal keeps its own meaning in both
languages: `audio_dubbing_video` (wrong format or length for dubbing),
`audio_dubbing_source` (no source video), `audio_separation_video`
(separation takes audio only). `audio_reference_video` now only means a
video the service cannot accept, and `audio_reference_count` and
`audio_reference_mix` were reworded to describe the wider matrix.

`#650`

Tests: `tests/test_seed_audio.py` covers a video travelling as
`reference_video`, a video with a voice clip travelling together, the
image-plus-video and separation-plus-video refusals, the declared type for
both container brands, and a published video arriving in the request body.
The publish test fails with an empty publish list before the adapter
change. `tests/test_localization.py` answers each new code in English and
Chinese. 236 passed across the seven modules touched by this branch.

* [fix] api: keep the subtitle transport message in one catalog

Audio issue codes reach the interface through `ENGLISH_BY_CODE` only, so the
duplicate entry in `CONTRACT_MESSAGES` carried a translation nothing reads.

Refs #650

* [feat] models: keep the provider object-storage account with the account

## summary

Ark can only read media from an address it can fetch itself, so 翻配,
视频参考 and 按字幕配音 all need the same thing first: the source media in
object storage the user owns, handed over as a signed URL. The store
already reads `storage` from a resolved model configuration, but nothing
wrote it, so every dubbing call died on `seed_audio_storage` before any
request went out. This adds the missing owner without inventing a second
place for credentials:

- `ModelConfigs` keeps `storage` (`accessKey`, `secretKey`, `bucket`,
  `region`) on the account layer next to the API key, so one Ark service
  and one bucket serve every model under it. It is validated on read,
  hoisted into the shared service record on write, and carried across
  edits of any model in that account.
- `storage()` answers Bucket, Region and whether the account is
  configured; neither secret is ever returned. `save_storage()` treats a
  blank field as "keep the stored value", so a settings screen never has
  to echo a secret back to change a bucket.
- An incomplete account is refused as a whole instead of failing later
  inside an adapter.

`#650`

Tests: `tests/test_model_configs.py` (36 passed) covers sharing across
one account, restart, secret masking, blank-field updates and refusal;
`tests/test_seed_audio.py` (41 passed) covers dubbing going out with the
presigned address, and refusing before any request when no account is
configured. The credential contract is written down in
`docs/architecture/unified-project.md`.

* [feat] api: let a model service hold its object-storage credentials

## summary

The storage account added for remote-fetch providers had no way in from
outside the process, so a user could not actually configure 翻配 or
视频参考. Two endpoints on the existing model-service resource close that:
`GET /api/model-services/{id}/storage` reports the bucket, region and
whether the account is usable, `POST` stores the four credentials.

Neither secret comes back: the response is a separate public shape with
no key fields at all, and the saved account is shared by every model of
the same provider service. A blank field keeps the stored value, so
changing a bucket never requires re-entering the secret, and an account
with only some of the four fields is refused up front.

The two refusals carry stable codes (`model_storage_incomplete`,
`model_storage_invalid`) registered in the contract issue codes and the
English catalog, so the interface answers them in its own language
instead of echoing Chinese.

`#650`

Tests: `tests/test_model_configs.py` (37 passed) covers the read before
any account exists, saving, masking, blank-field updates, the 409
refusal in both languages and the 404 for a deleted service;
`tests/test_creation_contracts.py` (82 passed) regenerates and checks the
new contract shapes.

* [refactor] audio: publish provider media through one helper

## summary

Ark can only read what it can fetch itself, so every request that carries
a file has to put it in the user's bucket first and hand over a signed
address. Dubbing did that inline for its video and, once subtitles
arrived, a second nearly identical block grew inside the same branch —
two copies of put, presign, cleanup and error mapping that the reference
and subtitle paths would each have had to repeat.

`_publish_media(config, task_id, data, suffix, content_type, noun=...)`
now owns that step: it refuses before writing anything when the account
is unconfigured, writes the bytes to a temporary file, uploads, presigns
for an hour and always removes the temp file. Dubbing calls it for the
video and for the subtitle, so the behaviour is the one already covered
by the existing dubbing and subtitle tests, not a new one.

The noun stays a parameter so a failure still says which file could not
be published; the error code keeps coming from the transfer so the
interface can answer in its own language.

`#650`

Tests: `tests/test_seed_audio.py` + `tests/test_result_artifacts.py`
53 passed, including the dubbing body carrying the presigned video URL and
the subtitle travelling with it.

* [refactor] audio: decide storage readiness in one place

## summary

Two call sites now need the same yes/no answer about the provider account:
the upload helper itself, and the subtitle path, which has to tell "this
job has a subtitle and nothing to publish it with" apart from a plain
missing account before it calls the helper. Keeping the four-field test
in both places would let them drift, and a drifting readiness check shows
up as a wrong error code rather than a test failure.

`_storage_ready(config)` holds it once and `_publish_media` asks it, so
the subtitle path and the helper can never disagree about whether the
same account is usable.

It stays on the Ark adapter: object storage is a property of a provider
that only reads remote URLs, not of every generation provider, and the
base class has no other reason to know about buckets.

`#650`

Tests: `tests/test_seed_audio.py` + `tests/test_result_artifacts.py`
53 passed, including dubbing refused with `seed_audio_storage` before any
request when no account is configured, and publishing the video and
subtitle when one is.

* [feat] assets: upload a subtitle file as a subtitle asset

## summary

按字幕配音 needs an uploaded SRT, but the upload inspector only recognised
`.txt` and `.md` as text. An `.srt` fell through to the media branch and
came back as a generic file, so no subtitle asset could ever exist and
`subtitleAssetId` was unreachable from the interface — the validation in
the audio reference layer was correct and simply could never be satisfied.

`.srt` now inspects as text with `application/x-subrip`, which is the type
the reference layer already accepts. The size and UTF-8 checks are the
existing text ones; a subtitle that is not valid SRT timings is still
refused later, by the rule that owns that judgement.

`#650`

Tests: `tests/test_creation_assets.py::test_an_srt_upload_becomes_a_subtitle_asset`
uploads a real SRT through the API and reads the bytes back;
`tests/test_seed_audio.py` now asserts the reference layer accepts both
`text/plain` and `application/x-subrip` subtitles. That test failed with
`kind == 'file'` before `.srt` was recognised. 235 passed across the seven
modules touched by this branch.

* [feat] audio: accept the four reference shapes Seed Audio allows

## summary

The provider takes exactly four reference combinations: one image, one
video, up to six voice clips, or one video with voice clips. The adapter
only ever implemented the first and third. A video fell into the "not
supported" branch unless the task was dubbing, and voice clips were
refused next to a video, so 视频参考生音频 and 音视频参考生音频 could not be
requested at all — both are in the acceptance list for `#650`.

Video is now a reference like any other. Dubbing keeps its own role
`dubbing_video` and its MP4-only bound; every other task sends
`reference_video` and accepts MP4 or MOV. Because the service can only
fetch video from a URL, a reference video goes through the same
`_publish_media` path as the dubbing source, and the declared content type
follows the container brand instead of assuming MP4.

The mix rule now states the real constraint: image cannot be combined with
video or voice, and dubbing cannot carry voice clips. Image plus voice
stays refused, as before.

Three codes were added so each refusal keeps its own meaning in both
languages: `audio_dubbing_video` (wrong format or length for dubbing),
`audio_dubbing_source` (no source video), `audio_separation_video`
(separation takes audio only). `audio_reference_video` now only means a
video the service cannot accept, and `audio_reference_count` and
`audio_reference_mix` were reworded to describe the wider matrix.

`#650`

Tests: `tests/test_seed_audio.py` covers a video travelling as
`reference_video`, a video with a voice clip travelling together, the
image-plus-video and separation-plus-video refusals, the declared type for
both container brands, and a published video arriving in the request body.
The publish test fails with an empty publish list before the adapter
change. `tests/test_localization.py` answers each new code in English and
Chinese. 236 passed across the seven modules touched by this branch.

* [bugfix] canvas: let a video feed a dubbing node

## summary

A video node could not feed a dubbing node. The canvas type matrix let an
audio node take a video only from an image, so `reference.add` answered
`reference_invalid` for exactly the reference dubbing needs and the
assistant could not start the job at all.

Both tables change together because the assembly test asserts the Python
set and the TypeScript table are the same product truth.

## verification

- `Ran:` tests/test_creation_assembly.py, tests/test_agent_seed_audio.py
- Before the change the assistant test failed in `reference.add` with
  `reference_invalid` "该节点类型不能作为目标节点的参考。"

* [bugfix] canvas: send an audio node the media its model declares

## summary

Every media reference attached to an audio generation was demoted to
`context_only`, so no image, video or voice clip could ever reach the
provider. The audio branch was written when an audio node meant speech or
music, and only a music recording was allowed through; Seed Audio dubbing,
separation and reference tasks all take media, and their declared
capability contract already says so.

Transmission now follows the same capability contract the rest of the
product uses: a media kind the model accepts, with a remaining slot for
that kind, travels as `content`; anything else stays `context_only`.

## verification

- `Ran:` tests/test_seed_audio.py, tests/test_agent_seed_audio.py,
  tests/test_creation_parameters.py
- Without the change the assistant test failed before any request with
  "翻配需要引用一段视频。" because the accepted video never left the project.

* [bugfix] audio: run the operation Seed Audio declares and record what it returns

## summary

The Seed Audio route never ran the operation the task asked for. The
parameter builder wrote the operation under `task`, while the adapter and
the reference builder read `taskType`, so dubbing and separation fell back
to plain text-to-audio: a dubbing job carried no video and the provider
answered with an ordinary speech file the project accepted as a success.

Dubbing also returns a re-voiced video rather than audio, which the job
contract refused: an audio execution could only own an audio asset. The
execution record now names the media the provider delivers, and the result
is registered with that kind instead of the model kind.

## verification

- `Ran:` tests/test_agent_seed_audio.py, tests/test_seed_audio.py,
  tests/test_creation_parameters.py, tests/test_creation_generation_service.py,
  tests/test_creation_contracts.py
- Without the parameter change the assistant test posted a text-only body
  and failed on the missing `video_url`.
- Without the delivered-kind record the same test failed at save with
  "Job execution/output kind differs from its inputs".

* [bugfix] models: build the public model shape in one place

## summary

Four call sites rebuilt `ModelConfigPublic` by copying the resolved
service record and dropping only `apiKey`. Once a model service also
carried its object-storage credentials, the strict public shape rejected
the extra key and every spec projection failed with
`invalid_input: "storage: Extra inputs are not permitted"`, which reached
the user as a refusal to submit work at all.

One factory drops everything the public shape must never carry, so a
future service-level field cannot break submission again.

## verification

- `Ran:` tests/test_agent_seed_audio.py, tests/test_creation_parameters.py,
  tests/test_creation_canvas_service.py, tests/test_creation_node_versions.py
- Before the change the assistant test failed with
  `invalid_input: "storage: Extra inputs are not permitted"` before any
  request was sent.

* [test] agent: dub a video through the assistant

## summary

Every Seed Audio test built its own task dictionary, so the assistant and
canvas path was never exercised: parameter projection, reference
transmission, the outbound body and result registration could each break
while the suite stayed green. These tests drive `execute_command` the way
the agent does and check the request that left the process, the files that
came back, and the timeline that can hold the extra voice track.

Writing them exposed four real defects: the video node could not reference
the audio node, the reference was demoted to `context_only`, the operation
key was never read, and an audio execution could not own the video that
dubbing returns.

## verification

- `Ran:` tests/test_agent_seed_audio.py
- The request assertion requires a `dubbing_video` reference and no text.
- The timeline assertion requires the generated composite track to be
  placeable as an audio clip beside the dubbed video.

* [feat] models: keep the provider object-storage account with the account

## summary

Ark can only read media from an address it can fetch itself, so 翻配,
视频参考 and 按字幕配音 all need the same thing first: the source media in
object storage the user owns, handed over as a signed URL. The store
already reads `storage` from a resolved model configuration, but nothing
wrote it, so every dubbing call died on `seed_audio_storage` before any
request went out. This adds the missing owner without inventing a second
place for credentials:

- `ModelConfigs` keeps `storage` (`accessKey`, `secretKey`, `bucket`,
  `region`) on the account layer next to the API key, so one Ark service
  and one bucket serve every model under it. It is validated on read,
  hoisted into the shared service record on write, and carried across
  edits of any model in that account.
- `storage()` answers Bucket, Region and whether the account is
  configured; neither secret is ever returned. `save_storage()` treats a
  blank field as "keep the stored value", so a settings screen never has
  to echo a secret back to change a bucket.
- An incomplete account is refused as a whole instead of failing later
  inside an adapter.

`#650`

Tests: `tests/test_model_configs.py` (36 passed) covers sharing across
one account, restart, secret masking, blank-field updates and refusal;
`tests/test_seed_audio.py` (41 passed) covers dubbing going out with the
presigned address, and refusing before any request when no account is
configured. The credential contract is written down in
`docs/architecture/unified-project.md`.

* [feat] api: let a model service hold its object-storage credentials

## summary

The storage account added for remote-fetch providers had no way in from
outside the process, so a user could not actually configure 翻配 or
视频参考. Two endpoints on the existing model-service resource close that:
`GET /api/model-services/{id}/storage` reports the bucket, region and
whether the account is usable, `POST` stores the four credentials.

Neither secret comes back: the response is a separate public shape with
no key fields at all, and the saved account is shared by every model of
the same provider service. A blank field keeps the stored value, so
changing a bucket never requires re-entering the secret, and an account
with only some of the four fields is refused up front.

The two refusals carry stable codes (`model_storage_incomplete`,
`model_storage_invalid`) registered in the contract issue codes and the
English catalog, so the interface answers them in its own language
instead of echoing Chinese.

`#650`

Tests: `tests/test_model_configs.py` (37 passed) covers the read before
any account exists, saving, masking, blank-field updates, the 409
refusal in both languages and the 404 for a deleted service;
`tests/test_creation_contracts.py` (82 passed) regenerates and checks the
new contract shapes.

* [refactor] audio: publish provider media through one helper

## summary

Ark can only read what it can fetch itself, so every request that carries
a file has to put it in the user's bucket first and hand over a signed
address. Dubbing did that inline for its video and, once subtitles
arrived, a second nearly identical block grew inside the same branch —
two copies of put, presign, cleanup and error mapping that the reference
and subtitle paths would each have had to repeat.

`_publish_media(config, task_id, data, suffix, content_type, noun=...)`
now owns that step: it refuses before writing anything when the account
is unconfigured, writes the bytes to a temporary file, uploads, presigns
for an hour and always removes the temp file. Dubbing calls it for the
video and for the subtitle, so the behaviour is the one already covered
by the existing dubbing and subtitle tests, not a new one.

The noun stays a parameter so a failure still says which file could not
be published; the error code keeps coming from the transfer so the
interface can answer in its own language.

`#650`

Tests: `tests/test_seed_audio.py` + `tests/test_result_artifacts.py`
53 passed, including the dubbing body carrying the presigned video URL and
the subtitle travelling with it.

* [refactor] audio: decide storage readiness in one place

## summary

Two call sites now need the same yes/no answer about the provider account:
the upload helper itself, and the subtitle path, which has to tell "this
job has a subtitle and nothing to publish it with" apart from a plain
missing account before it calls the helper. Keeping the four-field test
in both places would let them drift, and a drifting readiness check shows
up as a wrong error code rather than a test failure.

`_storage_ready(config)` holds it once and `_publish_media` asks it, so
the subtitle path and the helper can never disagree about whether the
same account is usable.

It stays on the Ark adapter: object storage is a property of a provider
that only reads remote URLs, not of every generation provider, and the
base class has no other reason to know about buckets.

`#650`

Tests: `tests/test_seed_audio.py` + `tests/test_result_artifacts.py`
53 passed, including dubbing refused with `seed_audio_storage` before any
request when no account is configured, and publishing the video and
subtitle when one is.

* [feat] assets: upload a subtitle file as a subtitle asset

## summary

按字幕配音 needs an uploaded SRT, but the upload inspector only recognised
`.txt` and `.md` as text. An `.srt` fell through to the media branch and
came back as a generic file, so no subtitle asset could ever exist and
`subtitleAssetId` was unreachable from the interface — the validation in
the audio reference layer was correct and simply could never be satisfied.

`.srt` now inspects as text with `application/x-subrip`, which is the type
the reference layer already accepts. The size and UTF-8 checks are the
existing text ones; a subtitle that is not valid SRT timings is still
refused later, by the rule that owns that judgement.

`#650`

Tests: `tests/test_creation_assets.py::test_an_srt_upload_becomes_a_subtitle_asset`
uploads a real SRT through the API and reads the bytes back;
`tests/test_seed_audio.py` now asserts the reference layer accepts both
`text/plain` and `application/x-subrip` subtitles. That test failed with
`kind == 'file'` before `.srt` was recognised. 235 passed across the seven
modules touched by this branch.

* [feat] audio: accept the four reference shapes Seed Audio allows

## summary

The provider takes exactly four reference combinations: one image, one
video, up to six voice clips, or one video with voice clips. The adapter
only ever implemented the first and third. A video fell into the "not
supported" branch unless the task was dubbing, and voice clips were
refused next to a video, so 视频参考生音频 and 音视频参考生音频 could not be
requested at all — both are in the acceptance list for `#650`.

Video is now a reference like any other. Dubbing keeps its own role
`dubbing_video` and its MP4-only bound; every other task sends
`reference_video` and accepts MP4 or MOV. Because the service can only
fetch video from a URL, a reference video goes through the same
`_publish_media` path as the dubbing source, and the declared content type
follows the container brand instead of assuming MP4.

The mix rule now states the real constraint: image cannot be combined with
video or voice, and dubbing cannot carry voice clips. Image plus voice
stays refused, as before.

Three codes were added so each refusal keeps its own meaning in both
languages: `audio_dubbing_video` (wrong format or length for dubbing),
`audio_dubbing_source` (no source video), `audio_separation_video`
(separation takes audio only). `audio_reference_video` now only means a
video the service cannot accept, and `audio_reference_count` and
`audio_reference_mix` were reworded to describe the wider matrix.

`#650`

Tests: `tests/test_seed_audio.py` covers a video travelling as
`reference_video`, a video with a voice clip travelling together, the
image-plus-video and separation-plus-video refusals, the declared type for
both container brands, and a published video arriving in the request body.
The publish test fails with an empty publish list before the adapter
change. `tests/test_localization.py` answers each new code in English and
Chinese. 236 passed across the seven modules touched by this branch.

* [bugfix] canvas: let a video feed a dubbing node

## summary

A video node could not feed a dubbing node. The canvas type matrix let an
audio node take a video only from an image, so `reference.add` answered
`reference_invalid` for exactly the reference dubbing needs and the
assistant could not start the job at all.

Both tables change together because the assembly test asserts the Python
set and the TypeScript table are the same product truth.

## verification

- `Ran:` tests/test_creation_assembly.py, tests/test_agent_seed_audio.py
- Before the change the assistant test failed in `reference.add` with
  `reference_invalid` "该节点类型不能作为目标节点的参考。"

* [bugfix] canvas: send an audio node the media its model declares

## summary

Every media reference attached to an audio generation was demoted to
`context_only`, so no image, video or voice clip could ever reach the
provider. The audio branch was written when an audio node meant speech or
music, and only a music recording was allowed through; Seed Audio dubbing,
separation and reference tasks all take media, and their declared
capability contract already says so.

Transmission now follows the same capability contract the rest of the
product uses: a media kind the model accepts, with a remaining slot for
that kind, travels as `content`; anything else stays `context_only`.

## verification

- `Ran:` tests/test_seed_audio.py, tests/test_agent_seed_audio.py,
  tests/test_creation_parameters.py
- Without the change the assistant test failed before any request with
  "翻配需要引用一段视频。" because the accepted video never left the project.

* [bugfix] audio: run the operation Seed Audio declares and record what it returns

## summary

The Seed Audio route never ran the operation the task asked for. The
parameter builder wrote the operation under `task`, while the adapter and
the reference builder read `taskType`, so dubbing and separation fell back
to plain text-to-audio: a dubbing job carried no video and the provider
answered with an ordinary speech file the project accepted as a success.

Dubbing also returns a re-voiced video rather than audio, which the job
contract refused: an audio execution could only own an audio asset. The
execution record now names the media the provider delivers, and the result
is registered with that kind instead of the model kind.

## verification

- `Ran:` tests/test_agent_seed_audio.py, tests/test_seed_audio.py,
  tests/test_creation_parameters.py, tests/test_creation_generation_service.py,
  tests/test_creation_contracts.py
- Without the parameter change the assistant test posted a text-only body
  and failed on the missing `video_url`.
- Without the delivered-kind record the same test failed at save with
  "Job execution/output kind differs from its inputs".

* [bugfix] models: build the public model shape in one place

## summary

Four call sites rebuilt `ModelConfigPublic` by copying the resolved
service record and dropping only `apiKey`. Once a model service also
carried its object-storage credentials, the strict public shape rejected
the extra key and every spec projection failed with
`invalid_input: "storage: Extra inputs are not permitted"`, which reached
the user as a refusal to submit work at all.

One factory drops everything the public shape must never carry, so a
future service-level field cannot break submission again.

## verification

- `Ran:` tests/test_agent_seed_audio.py, tests/test_creation_parameters.py,
  tests/test_creation_canvas_service.py, tests/test_creation_node_versions.py
- Before the change the assistant test failed with
  `invalid_input: "storage: Extra inputs are not permitted"` before any
  request was sent.

* [test] agent: dub a video through the assistant

## summary

Every Seed Audio test built its own task dictionary, so the assistant and
canvas path was never exercised: parameter projection, reference
transmission, the outbound body and result registration could each break
while the suite stayed green. These tests drive `execute_command` the way
the agent does and check the request that left the process, the files that
came back, and the timeline that can hold the extra voice track.

Writing them exposed four real defects: the video node could not reference
the audio node, the reference was demoted to `context_only`, the operation
key was never read, and an audio execution could not own the video that
dubbing returns.

## verification

- `Ran:` tests/test_agent_seed_audio.py
- The request assertion requires a `dubbing_video` reference and no text.
- The timeline assertion requires the generated composite track to be
  placeable as an audio clip beside the dubbed video.

* [build] repo: keep a node_modules link out of the tree

## summary

A merge brought in a `node_modules` symlink pointing at an absolute path on
the machine that created it, and `.gitignore` matched only the directory
form, so the link passed the ignore rule. Untrack it and match both forms.

## verification

- `Ran:` git ls-files node_modules (empty after the change)
- `Not run:` nothing else; no source or test changed

* [feat] canvas: let a model declare the audio operation and collect what it needs

An audio model publishes audioTasks, but the canvas dropped that list at the
data boundary and only carried creationType and mode. Seed Audio 1.5 generates
speech, dubs a video and separates stems from the same model, so a user could
reach only the default operation.

The settings now carry audioTask, targetLanguage, sourceLanguage and
subtitleAssetId. dataBoundary keeps them, the projection writes the contract key
taskType plus the three dubbing fields, and the reverse mapping restores them.
chosenAudioTask prefers the user's choice and falls back to the first declared
task, audioTaskParameters sends a language only for dubbing, subtitleChoices
offers only application/x-subrip text assets, and backendBlocker refuses dubbing
without a target language.

Ran: node --test tests/audioTask.test.ts (5 passed)
Ran: ./node_modules/.bin/tsc --noEmit (clean)
Ran: npm test (1120 passed)
Ran: npm run check:i18n (3872 keys, 0 problems)

* [feat] canvas: name every artifact of a job in the version list

A job delivers a primary output plus audio tracks and subtitles, and the version
list showed those siblings as interchangeable versions. Adopting one would point
the node at a file the job never adopted.

node_versions now reports role, variant and track for each row, apply_node_version
refuses a non-primary row with result_not_adoptable, and the dialog labels the
side artifact and keeps the apply button off it. The subtitle row stays out of an
audio node because its kind differs.

Ran: python3 -m pytest tests/test_result_artifacts.py (12 passed)
Ran: node --test tests/artifactLabel.test.ts (1 passed)
Ran: python3 -m pytest tests/test_creation_node_versions.py tests/test_seed_audio.py tests/test_agent_seed_audio.py tests/test_creation_workflow.py tests/test_localization.py (99 passed, 1 filelock flake that passes alone)

* [feat] audio: complete Seed Audio 1.5 canvas, dubbing and re-voice flows

- add operation, language, audited-SRT, voice and outputVideo inputs to the
  canvas audio composer, and play a video result in the node
- list subtitle side artifacts separately so they stay reviewable without
  becoming adoptable node versions, and count the badge with the same filter
  as the version dialog
- validate every SRT cue locally and report a refused input as an input
  failure with specific zh-CN/en-US guidance before any provider request
- keep separation stem identity and mix a composite track, mux a playable
  re-voiced video, and record target/source subtitles from dubbing
- document the user journey and the live verification receipts

* [docs] audio: record the verified Seed Audio preset voices

* [style] audio: express the Seed Audio behavior through code

* [bugfix] audio: cache every delivered file before the adopted output

* [docs] audio: match the Seed Audio guide to the accepted input shapes

* [docs] audio: keep sibling adoption and version wording exact

* [build] repo: drop the unrelated ignore tweak from this PR

* [style] audio: remove the last explanatory code comments

* [bugfix] audio: localize object-storage failures and align the guide counts

* [bugfix] audio: keep specific input codes at the command boundary

* [feat] audio: finish the Seed Audio account, adoption and recovery paths

- let an audio node adopt the video primary its own dubbing job produced
- expose the Seed Audio object-storage setup in the model-service form
- resume recorded sibling artifacts instead of losing them on retry
- stop advertising the unpublished reference operation
- keep a failed upload temp-file cleanup from masking the transfer result

Co-Authored-By: Claude Code <noreply@anthropic.com>

* [style] audio: let the storage predicate carry its own meaning

* [bugfix] canvas: keep object-storage failure guidance after restart

A stored Seed Audio storage failure kept its Chinese text persisted in the
job record, so the English card fell back to the generic input category.
Map the storage-required and upload-failure messages to bilingual copy.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* [bugfix] audio: drop recorded artifact locators when a task is cleared

clear() removed the artifacts and artifacts.json but left
artifact-locators.json with presigned URLs behind. Unlink it too.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* test(ci): enroll seed audio and upstream Ark modules in Python shards

#692 split the Python suite into three shard manifests, but #676 added
tests/test_ark_availability.py after that list was generated, so the
manifest-coverage test fails on current main. Enroll that module together
with the seed-audio modules this branch adds so each test module is
collected exactly once.

* fix(canvas): do not label source subtitles with the target language

Source SRT/JSONL artifacts belong to the input language, but both artifact
notes appended the version's targetLanguage, so a zh->en dubbing job showed
"源字幕 · 英语" / "Source subtitles · English". Build the note once and
omit the language for source roles; target rows keep it.

* fix(provider): send MP3 voice references with Ark's accepted subtype

Uploaded MP3s are stored as audio/mpeg, and the adapter forwarded that MIME
into the inline data URL. Ark accepts only the mp3 and wav subtypes, so a
valid local MP3 reference reached the provider as audio/mpeg and failed.
Emit audio/mp3 for audio/mpeg (and audio/wav for audio/x-wav).

* fix(models): keep storage fields the user typed while a read is pending

Opening an existing service read its object-storage settings asynchronously
and replaced the whole form state when the response arrived, silently
discarding credentials typed in the meantime. Disable the storage fieldset
while the read is pending and merge a late response only into blank fields.

* [feat] models: fold object storage into an optional section

Text-to-audio needs only the API key. Video references, dubbing and
translation still need the account's TOS credentials, but the four
fields no longer dominate the Add service form: the section starts
collapsed, states that it is optional, and expands on demand.

The browser test pins the collapsed default and the four expanded
fields.

Co-Authored-By: Claude Code <noreply@anthropic.com>

* [ci] tests: enroll new main test modules in the Python shards

main (#681) added tests/test_trace_job_queries.py and
tests/test_wait_outcome.py; the release shard manifest must list every
test module exactly once.

* [test] agent: keep artifacts in the job-show delivery reference

#681 compares the optimized job.status delivery with a full-read
reconstruction. This branch adds artifact rows to the delivery, so the
reconstruction has to include them for the four variants.

* [ci] retry: desktop smoke did not focus project search

The macOS desktop smoke failed on fd32e7ad with 'Project search did not
take focus' while every other job passed; the same job passed on the
parent merge tip 2a37b068 and the only diff is a Python test reference.
Retrying to confirm runner flake.

* [ci] retry: desktop search focus smoke again

The macOS desktop smoke failed twice on the same app tree that passed
on 2a37b068 ('Project search did not take focus'); all other jobs are
green. This commit only retries that runner job.

* [bugfix] model services: save object storage atomically with the service

A batch edit rebuilt the provider's model rows and dropped their storage;
the follow-up storage POST then could not merge the keys the form never
reads back. New services could also leave a second connection set behind
when that second write failed and the user retried in the same form.

The batch write now carries existing storage forward, merges partial
updates (only bucket/region are read back) in the same transaction, and
accepts storage up front, so the form saves a service and its storage in
one request.

Refs #650

* [ci] retry: desktop search focus smoke

---------

Co-authored-by: dev <dev@example.com>
Co-authored-by: Zhangbo-cn <zhangbo@users.noreply.github.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] 火山视频能力查询返回 adapter_not_mapped,可能导致助手误判 Seedance 不可用

4 participants